/*
 * @(#)org.example.netty.http 2020/4/1/0001
 *
 * Copy Right@ 人人译视界
 */


package org.example.netty.http;

import io.netty.channel.ChannelInitializer;
import io.netty.channel.ChannelPipeline;
import io.netty.channel.socket.SocketChannel;
import io.netty.handler.codec.http.HttpServerCodec;

/**
 * <pre>
 * @author tuwei
 *
 * @version 0.9
 *
 * 修改版本: 0.9
 * 修改日期: 2020/4/1/0001
 * 修改人 :  tuwei
 * 修改说明: 初步完成
 * 复审人 ：
 * </pre>
 */
public class TestServerInitializer extends ChannelInitializer<SocketChannel> {
	@Override
	protected void initChannel(SocketChannel socketChannel) throws Exception {
		ChannelPipeline pipeline = socketChannel.pipeline();
		// netty提供的http编解码器
		pipeline.addLast("myHttpServerCodec", new HttpServerCodec());
		pipeline.addLast("myHttpServerHandler", new TestHttpServerHandler());
	}
}
